package com.yunchang.springboot.mapper.caravan;

import com.yunchang.springboot.config.BaseDao;
import com.yunchang.springboot.models.DO.CaravanMskuData;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author wanglongwei
 * @data 2019/9/3 17:11
 */
public interface CaravanMskuDataMapper extends BaseDao<CaravanMskuData> {

    /**
     * 根据日期删除数据
     *
     * @param date
     * @return
     */
    int deleteByDate(@Param("date") String date);

    /**
     * 根据参数获取一条数据
     *
     * @param shops
     * @param msku
     * @param amazonsite
     * @return
     */
    CaravanMskuData getOneInfoByShopsAndMskuAndAmazonsite(@Param("shops") String shops, @Param("msku") String msku, @Param("amazonsite") String amazonsite);

    /**
     * 获取最近的数据的日期
     * @return
     */
    String getLatestDate();

    List<CaravanMskuData> getAllList();

    /**
     * 根据sku获取stockSku
     * @param sku
     * @return
     */
    String getStockSku(String sku);

    /**
     * 根据参数获取stockSku
     * @param sku
     * @param amazonSite
     * @return
     */
    List<String> selectStockSkuBySkuAndAmazonSite(String sku, String amazonSite);

    /**
     * 根据参数获取stockSku
     * @param sellerId
     * @param amazonSite
     * @param sku
     * @return
     */
    String selectStockSkuBySellerIdAndCountryAndSku(String sellerId,String amazonSite,String sku);


    /**
     * 根据参数获取stockSku获取日期最大的stockSku
     * @param sku
     * @param amazonSite
     * @return
     */
    String selectStockSkuBySkuAndAmazonSiteAndDateMax(String sku, String amazonSite);
}
